<?php echo link_to(image_tag('icons/add2.png').'Nuevo','inventario/create') ?>


<table class="lista">
  <thead>
    <tr>
      <th></th>
      <th></th>
      <th><?php echo link_to("Clave",'inventario/index?sort='.ArticuloPeer::CODIGO)?></th>
      <th>Nombre</th>
      <th>Proveedor</th>
      <th>%Desc</th>            
      <th>Stock</th>
      <th>Reorden?</th>
    </tr>
  </thead>
  <tbody>
    <?php foreach ($articuloList->getResults() as $articulo): ?>
    <tr>
      <td><?php echo link_to(image_tag('icons/edit.png'),'inventario/edit?id='.$articulo->getId())?>Editar<br/>
      <?php echo link_to(image_tag('icons/delete.png'),'inventario/delete?id='.$articulo->getId())?>Borrar</td>
      <td><?php echo image_tag('fotos/'.$articulo->getFoto(),array("width"=>"32") ) ?></td>
      <td><?php echo link_to($articulo->getCodigo(),'inventario/edit?id='.$articulo->getId()) ?></td>
      <td><?php echo $articulo->getNombre() ?></td>
      <td><?php echo $articulo->getProveedor()?></td>
      <td><?php echo $articulo->getDescuento() ?></td>
      <td><?php echo $articulo->getExistencia() ?></td>
      <td><?php echo $articulo->getReordenacion() ?></td>
    </tr>
    <?php endforeach; ?>
  </tbody>
  <tfoot>
    <tr>
      <td colspan="5"><strong><?php echo $articuloList->getNbResults() ?></strong> Artículos</td>
      <td colspan="3">
        Página <?php if ( $articuloList->haveToPaginate() ): ?>
          <?php echo link_to('&laquo', 'inventario/index?list=all&page='.$articuloList->getFirstPage()) ?>
          <?php echo link_to('&lt;', 'inventario/index?list=all&page='.$articuloList->getPreviousPage()) ?>
          <?php $links = $articuloList->getLinks(); foreach ($links as $page): ?>
            <?php echo ($page == $articuloList->getPage()) ? $page : link_to($page, 'inventario/index?list=all&page='.$page) ?>
            <?php if ($page != $articuloList->getCurrentMaxLink()): ?> - <?php endif ?>
          <?php endforeach ?>
          <?php echo link_to('&gt;', 'inventario/index?list=all&page='.$articuloList->getNextPage()) ?>
          <?php echo link_to('&raquo;', 'inventario/index?list=all&page='.$articuloList->getLastPage()) ?>        
       <?  endif ?>
      </td>
    </tr>
  </tfoot>
</table>
